<template>
  <div>
    <router-view />
    <van-tabbar
      v-model="active"
      active-color="#4662aa"
      route
      v-if="$route.meta.showTap"
      @change="onChange"
    >
      <van-tabbar-item to="/home" icon="home-o">首页</van-tabbar-item>
      <van-tabbar-item to="/question" icon="chat-o" badge="5"
        >问答</van-tabbar-item
      >
      <van-tabbar-item to="/movie" icon="video-o">视频</van-tabbar-item>
      <van-tabbar-item to="/my" icon="manager-o">我的</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
export default {
  data () {
    return {
      active: 'home'
    }
  },
  methods: {
    onChange (index) {
      if (index === 0) {
        console.log(this.icon)
        this.icon = 'live'
      }
    }
  }
}
</script>

<style></style>
